The app is the app's function to open the Google Maps active address connection to your iphoneCurrent version of SDK 8.4 XcodeRun Xcode Select Create a new Xcode project->single View application named OpenURL(1) Open ViewController.h file in Xcode(Red is the added code)#import @interface Viewcontroller: uiviewcontroller -(ibaction) Openmaps: (ID) sender; @end(2) Open viewcontroller.m file in Xcode#import "ViewController.h"@interface viewcontroller (
the content of Item1 to MyApp. Other programs can access this custom URL through MyApp: //
References:
P. P1 {margin: 0.0px 0.0px 0.0px 0.0px; Font: 14.0px Menlo}
Http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
Openurl can help you run maps, SMS, browser, phone, and other applications. This is a piece of code that I often need during iPhone development. It only has one line.
View plaincopyTo clipboardprint?
-(Ibaction)
identifier to URL scheme, expand URL Scheme, modify the contents of Item1 to MyApp Other programs can access this custom URL through myapp://Resources:P.P1 {margin:0.0px 0.0px 0.0px 0.0px; font:14.0px Menlo}Http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.htmlOpenURL can help you run Maps,sms,browser,phone and even other applications. This is a piece of code that I often need to use in iphone development, and it's just a single line.View Plaincopy to Clipbo
Scheme, modify the contents of Item1 to MyApp Other programs can access this custom URL through myapp://Resources:P.P1 {margin:0.0px 0.0px 0.0px 0.0px; font:14.0px Menlo}Http://iphonedevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.htmlOpenURL can help you run Maps,sms,browser,phone and even other applications. This is a piece of code that I often need to use in iphone development, and it's just a single line.View Plaincopy to Clipboardprint?
-(ibaction)
?q=Shanghai2.Email Mailto://[email protected]3.Tel tel://100864.MSG sms://10086OpenURL can help you run Maps,sms,browser,phone and even other applications. This is a piece of code that I often need to use in iphone development, and it's just a single line.-(ibaction) Openmaps {Open mapNsstring*addresstext = @ "Beijing";@ "1Infinite Loop, Cupertino, CA 95014";Addresstext =[addresstextstringbyaddingpercentescapesusingencoding:nsasciistringencoding];Nsst
The code is as follows
Copy Code
-(ibaction) Openmaps {Where is Apple on the map anyway?nsstring* Addresstext = @ "1 Infinite Loop, Cupertino, CA 95014";URL encode the spacesAddresstext = [Addresstext stringbyaddingpercentescapesusingencoding:nsasciistringencoding];nsstring* Urltext = [NSString stringwithformat:@ "http://maps.google.com/maps?q=%@", Addresstext];Lets throw this text on the "so we can view" URL in the event we have a iss
-(Ibaction) openmaps {// Where is apple on the map anyway? Nsstring * addresstext = @ "1 infinite loop, Cupertino, CA 95014"; // URL encode the spaces addresstext = [addresstext failed: Empty]; nsstring * urltext = [nsstring stringwithformat: @ "http://maps.google.com/maps? Q = % @ ", addresstext]; // Lets throw this text on the log so we can view the URL in the event we have an issue nslog (urltext ); [[uiapplication sharedapplication] Openurl: [nsur
Use Openurl: [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: appstring];The system appstring includes:1. Map http://maps.google.com/maps? Q = Shanghai2. email mailto: // myname@google.com3. Tel: // 100864. msg sms: // 10086Openurl can help you run maps, SMS, browser, phone, and other applications.Program. This is a frequently used section in iPhone development.CodeIt only has one row.
// Open the map
-(Ibaction) openmaps {Nsstring
Today, I met a line of code to open a webpage, which is much easier to implement than the uiwebview control in my impression. It is easy to use and can be easily used after real machine testing, I searched for some related information on the Internet:
Code segment: [[uiapplication sharedapplication] Openurl: url];
The system URL includes:1. Map http://maps.google.com/maps? Q = Shanghai2. email mailto: // myname@google.com3. Tel: // 100864. msg sms: // 10086
-(Ibaction)
-(IBAction) openMaps {// Where is Apple on the map anyway?NSString * addressText = @ "1 Infinite Loop, Cupertino, CA 95014 ";// URL encode the spacesAddressText = [addressText stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];NSString * urlText = [NSString stringWithFormat: @ "http://maps.google.com/maps? Q = % @ ", addressText];// Lets throw this text on the log so we can view the url in the event we have an issueNSLog (urlText );[[UI
also have Google map search, Mail, call, send text messages, open AppStore.
-(Ibaction) openmaps {//Open mapWhere is Apple on the map anyway?nsstring* Addresstext = @ "1 Infinite Loop, Cupertino, CA 95014″;URL encode the spacesAddresstext = [Addresstext stringbyaddingpercentescapesusingencoding:nsasciistringencoding];nsstring* Urltext = [NSString stringwithformat:@ "http://maps.google.com/maps?q=%@", Addresstext];Lets throw this text on
Openurl can help you run maps, SMS, browser, phone, and other applications.Program. This is a frequently used section in iPhone development.CodeIt only has one row.[[Uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "Tel: // 8004664411"];This program supports the call function through the basic protocol.Attach:-(Ibaction) openmaps {// open the map// Where is apple on the map anyway?
Nsstring * addresstext = @ "1 infinite loop, Cupert
Open Baidu Map by calling the device's own browser1 //1. Define a method to open the features of Google Maps2-(ibaction) openmaps3 {4 //2. Define a string, as the current location of Baidu map abandoned5NSString *addresstest =@"";6 //3. In the request URL path, if the Chinese language is included, the request will be unsuccessful. This is the need to convert the Chinese parameter to the U.S. Standard Information Interchange code. 7Addresstest =[Addresstest stringbyaddingpercentescapesusi
:[nsstring class]] [url Hasprefix:scheme]) {Bschemeinplist = YES;}}}}Check If the authorization callback would workBOOL Bcanopenurl = [[uiapplication sharedapplication] Canopenurl:[nsurl Urlwithstring:url]];if (!bschemeinplist | |!bcanopenurl) {Uialertview *alertview = [[Uialertview alloc]initwithtitle:@ "Setup Error"message:@ "Invalid or missing URL scheme. You cannot run the app until your set up a valid URL scheme in your. plist. "Delegate:selfcancelbuttontitle:@ "OK"Otherbuttontitles:nil,NIL
The code is as follows
-(ibaction) Openmaps {
Where is Apple on the map anyway?
nsstring* Addresstext = @ "1 Infinite Loop, Cupertino, CA 95014";
URL encode the spaces
Addresstext = [Addresstext stringbyaddingpercentescapesusingencoding:nsasciistringencoding];
nsstring* Urltext = [NSString stringwithformat:@ "http://maps.google.com/maps?q=%@", Addresstext];
Lets throw this text on the "so we can view" URL in the event we have a issue
NSLog (Ur
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.